unit uReportFactory;

interface

uses

  Classes, uReportHandle, ADODB, DB, uReportData;

type

  TReportFactor = class
  class function GetReportState(aType: TReportType;
    aADOConn: TADOConnection): TReportHandle;
  end;

implementation

uses uReportOrder, uReportOrderProcedure, uReportMaterielIn, uReportMaterielOut,
  uReportProductIn, uReportProductOut, uReportSemiProductIn,
  uReportProductAlarm, uReportMaterielAlarm;




{ TReportFactor }

class function TReportFactor.GetReportState(aType: TReportType;
  aADOConn: TADOConnection): TReportHandle;
begin
  case aType of
    Report_Order:          Result := TOrderReport.Create(aADOConn);
    Report_OrderProcedure: Result := TOrderProcedureReport.Create(aADOConn);
    Report_MaterielIn:     Result := TMaterielInReport.Create(aADOConn);
    Report_MaterielOut:    Result := TMaterielOutReport.Create(aADOConn);
    Report_ProductIn:      Result := TProductInReport.Create(aADOConn);
    Report_ProductOut:     Result := TProductOutReport.Create(aADOConn);
    Report_SemiProductIn:  Result := TSemiProductInReport.Create(aADOConn);
    Report_ProductAlarm:   Result := TProductAlarmReport.Create(aADOConn);
    Reprot_MaterielAlarm:  Result := TMaterielAlarmReport.create(aADOConn);
    else
      Result := nil;
  end;

end;

end.
